-
Notifications
You must be signed in to change notification settings - Fork 753
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Plotting #2338
base: dev
Are you sure you want to change the base?
Plotting #2338
Conversation
another potential use case is plotting some of the variates in the multivariate forecasting case... can we get a helper for that too? |
Thanks for the input, @kashif. 👍 The |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My feeling is that we should have many different functions for different tasks. Say I want to compare the output of two models on the same data, then we probably want to plot it differently than just plotting the data for one model.
Can you check if this will also work for Quantile forecasts? |
It does not. 😄 PR #2352 should fix this. |
Description of changes:
This PR addresses #2333 and proposes a
plot
function that is given a forecast and optionally a time series for reference as well as a bunch of options about how to plot things.The most interesting part is plotting the different prediction intervals. This now works pretty much as in
Forecast.plot
. The only major difference is that the lower and upper parts of each prediction interval are created separately to keep the colors true (in Forecast.plot, when plotting a lot of prediction intervals, the colors in the middle get very dark because thealpha
of the color gets less with each overlap).The
plot_prob_forecasts
used in this tutorial can be replaced by a call tolab.plot
. Also, the vertical red line in the tutorial can be created using thetrain_test_separator
parameter.It might make sense to return the Matplotlib
fig
andax
so that the user can draw more custom things on top of it (like highlighting the train vs. test data in different colors as is done here).This proposal would pretty much replace the
plot
method ofForecast
. I think this makes sense because plotting is something separate and the Forecasts would be more lightweight this way.Biggest caveat at the moment: 150 lines is a lot of code to just plot a forecast. Just providing all the different knobs for the user to choose (like color, legend position etc.) makes things a bit messy but not providing them would render the
plot
function pretty useless, I think. So, maybe there's an easier way to do this.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.